import {request} from 'network/request.js'
import Qs from 'qs'

export function addTruck(payload){
  return request({
    url: '/addTruck',
    method: "post",
    headers: {'Content-Type': 'application/x-www-form-urlencoded'},
    data: Qs.stringify(payload)
  })
}

export function getTruck(payload){
  return request({
    url: '/getTruck',
    params: payload
  })
}

export function updTruck(payload){
  return request({
    url: '/updTruck',
    method: "post",
    headers: {'Content-Type': 'application/x-www-form-urlencoded'},
    data: Qs.stringify(payload)
  })
}

export function truckDepart(payload){
  return request({
    url: '/truckDepart',
    method: "post",
    headers: {'Content-Type': 'application/x-www-form-urlencoded'},
    data: Qs.stringify(payload,{indices:false})
  })
}

export function getWaitTruck(name){
  return request({
    url: '/getWaitTruck',
    params: {name:name}
  })
}

export function getDocByDispa(id){
  return request({
    url: '/getDocByDispa',
    params: {id:id}
  })
}

export function selDispatch(payload){
  return request({
    url: '/selDispatch',
    method: "post",
    headers: {'Content-Type': 'application/x-www-form-urlencoded'},
    data: Qs.stringify(payload)
  })
}
